<template>
  <div>
    <swiper :options="swiperOption" @someSwiperEvent="callback" key="TopSwiper">
      <!-- slides -->
      <swiper-slide v-for="item of swipers" :key="item.pid">
        <img class="swiper-img" :src="item.imgUrl" />
      </swiper-slide>
      <!-- Optional controls -->
      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
export default {
  name: "HomeSwiper",
  props: {
    swipers: {
      type: Array,
      default: null
    }
  },
  data() {
    return {
      swiperOption: {
        pagination: ".swiper-pagination",
        loop: true,
        autoplay: 2500
      }
    };
  },
  methods: {
    callback(index) {}
  }
};
</script>

<style lang="stylus" scoped>
div >>> .swiper-pagination-bullet-active {
  background: #fff;
}

.swiper-img {
  width: 100%;
  height: 32.9vw;
  overflow: hidden;
}
</style>